package com.walle.ak47.commons.jaxrs.header;


public class HeaderHolder {
	
	/** 如后续ThreadLocal中保存常驻内存数据且不断递增时，需要调用remove方法避免内存溢出 */
	private static ThreadLocal<HeaderInfo> header = new ThreadLocal<HeaderInfo>() {
		@Override
		protected HeaderInfo initialValue() {
			return new HeaderInfo();
		}
	};

	public static HeaderInfo getHeader() {
        return header.get();
    }

    public static void removeHeader() {
        header.remove();
    }
    
    public static void setHeader(HeaderInfo env) {
    	header.set(env);
    }

}
